package com.yenlien.traceyun.control.dao;

import com.yenlien.traceyun.control.entity.Birth;
import com.yenlien.traceyun.webase.dao.BaseJpaDao;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * Created by LiuSha on 2020/3/24.
 */
public interface BirthDao extends BaseJpaDao<Birth> {
    Birth findById(String id);

    @Query(value = "select * from t_birth where model_id = ?1 ORDER BY sort ", nativeQuery = true)
    List<Birth> findByModelId(String modelId);

    /**
     * 根据modelIds删除
     *
     * @param modelIds
     */
    public void deleteByModelIdIn(List<String> modelIds);

    public void deleteByModelId(String modelId);
}
